import requests, unittest
class TestiHRMLogin(unittest.TestCase):
    def test01_login_ok(self):
        resp = requests.post(url="https://heimahr.itheima.net/api/sys/login",
                             headers={"true": "application/json;charset=UTF-8"},
                             data={
                                 "mobile": "13800000002",
                                 "password": "hm#qd@23!",
                                 "isAgree": "true"
                             })

        jsonData = resp.json()
        self.assertEqual(200, resp.status_code)
        self.assertEqual(True, jsonData.get("success"))
        self.assertEqual(10000, jsonData.get("code"))
        self.assertIn('登录成功', jsonData.get("message"))


if __name__ == '__main__':
    unittest.main()